package cn.wolfcode.transfer.qo;

import java.util.List;

public class PageResult {
    private int currentPage;
    private int pageSize;
    private int totalCount;
    private List totalList;
    private int totalPage;
    private int prevPage;
    private int nextPage;

    public PageResult(int currentPage, int pageSize, int totalCount, List totalList) {
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        this.totalList = totalList;
        this.totalPage=totalCount%pageSize==0?totalCount/pageSize:totalCount/pageSize+1;
        this.prevPage=currentPage-1<1?currentPage:currentPage-1;
        this.nextPage=currentPage+1>totalPage?totalPage:currentPage+1;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalcount) {
        this.totalCount = totalcount;
    }

    public List getTotalList() {
        return totalList;
    }

    public void setTotalList(List totalList) {
        this.totalList = totalList;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getPrevPage() {
        return prevPage;
    }

    public void setPrevPage(int prevPage) {
        this.prevPage = prevPage;
    }

    public int getNextPage() {
        return nextPage;
    }

    public void setNextPage(int nextPage) {
        this.nextPage = nextPage;
    }
}
